package swing;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.io.IOException;

public class BackgroundImage extends JPanel
{
    Image image = null;
    public BackgroundImage()
    {
        try {
            image = ImageIO.read(getClass().getResourceAsStream("/swing/back4.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void paint(Graphics g)
    {
        g.drawImage(image, 0, 0, null);
    }
}
